#ifndef RD_SUNGARDPROTO_H_
#define RD_SUNGARDPROTO_H_

#ifdef WIN32
#pragma pack(push)
#pragma pack(1)
#define Y_RD_PACKED	
#else
#define Y_RD_PACKED	__attribute__ ((packed))
#endif

#ifndef Y_RD_USERNAME_LEN
#define	Y_RD_USERNAME_LEN				32+1
#define	Y_RD_USERID_LEN					10
#define Y_RD_PASSWD_LEN					32+1
#define	Y_RD_COUNTER_LEN				16
#define Y_RD_COOKIE_LEN					21
#define Y_RD_HOST_LEN					64

#define Y_RD_DATE_LEN						8
#define Y_RD_TIME_LEN						6
#define Y_RD_DATETIME_LEN					24
#define Y_RD_STOCKNAME_LEN					20
#endif //Y_RD_USERNAME_LEN

#define Y_RD_CONTACTID_LEN			8
#define Y_RD_CONTACTNAME_LEN		20

#define Y_RD_BUSSINESS_LEN	12
#define Y_RD_RESERVE_LEN		20
#define Y_RD_JYSNAME_LEN				8
#define Y_RD_CONTACTID_LEN			8
#define Y_RD_CONTACTNAME_LEN		20
#define Y_RD_IDENTITY_LEN				20
#define Y_RD_TEL_LEN						15
#define Y_RD_ADDR_LEN						20
#define Y_RD_EMAIL_LEN					20
#define Y_RD_ZIPCODE_LEN				8
#define Y_RD_REMARK_LEN					20
#define Y_RD_VARIETYID_LEN			8
#define Y_RD_VARIETYNAME_LEN		20
#define Y_RD_XWID_LEN				10
#define Y_RD_SYSID_LEN				12

//登录消息
struct _xLoginTrdSvrReq_t
{
	char userid[Y_RD_USERID_LEN];			//用户名
	char passwd[Y_RD_PASSWD_LEN];					//密码
	char businessid[Y_RD_BUSSINESS_LEN];	//
	int entrusttype;									//委托方式
	char clientip[Y_RD_HOST_LEN];									
	unsigned char cjts;							//是否接受成交推送
	unsigned char xxts;							//是否接受信息推送
}Y_RD_PACKED;
typedef struct _xLoginTrdSvrReq_t xLoginTrdSvrReq_t;

struct _xLoginTrdSvrAck_t
{
	char username[Y_RD_USERNAME_LEN];			//用户名
	int risklevel;
	int appendbail;											//追加保证金
	int securitylevel;									//客户安全类别
	char reserve1[Y_RD_RESERVE_LEN];
	char lastip[Y_RD_HOST_LEN];		
	char lastdate[Y_RD_DATE_LEN + 1];
	char lasttime[Y_RD_TIME_LEN + 1];
	char reserve2[Y_RD_RESERVE_LEN];
	unsigned char jsdmodel;					//结算单模式
	unsigned char jsdstate;					//结算单状态
}Y_RD_PACKED;
typedef struct _xLoginTrdSvrAck_t xLoginTrdSvrAck_t;

#ifdef WIN32
#pragma pack(pop)
#endif
#endif
